var cities = new Array();
cities = [
                <?foreach($this->cities as $city):?>
                    "<?=$city['name']?>",
                <?endforeach;?>
""];
$("#city").autocomplete(cities);